********************************************************************************
*
**# Table 5: Do DV Judges Make Different Decisions in Assault Cases?
*
********************************************************************************


use "${DATA}/data_ASLT.dta", clear


********************************************************************************
*
**##  Panel A 
*
********************************************************************************

# d ;

preserve ;

	keep if aslt_case ==1 ;

	eststo clear ;
	local m = 1;

	eststo tab5a_`m': 
	reghdfe guilty_case dv_judge , $hdfe_opts ;
	
		estadd ysumm			;
		estadd local cntrl "" 	;
		local m `++m'			;
						
	eststo tab5a_`m': 
	reghdfe guilty_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X" 	;
		local m `++m' 			;

	eststo tab5a_`m': 
	reghdfe guilty_count dv_judge , $hdfe_opts ;
	
		estadd ysumm			;
		estadd local cntrl "" 	;
		local m `++m' 			;
						
	eststo tab5a_`m': 
	reghdfe guilty_count dv_judge $cntrls ,$hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X" 	;
		local m `++m'	 		;
			
	eststo tab5a_`m': 
	reghdfe incarcerated_case dv_judge , $hdfe_opts  ;
	
		estadd ysumm			;
		estadd local cntrl "" 	;
		local m `++m' 			;
				
	eststo tab5a_`m': 			
	reghdfe incarcerated_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X"	;
		local m `++m' 			;

	eststo tab5a_`m': 
	reghdfe jail_time_case dv_judge , $hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "" 	;
		local m `++m' 			;

	eststo tab5a_`m': 			
	reghdfe jail_time_case dv_judge $cntrls , $hdfe_opts ;
	
		estadd ysumm 			;
		estadd local cntrl "X"  ;
		local m `++m' 			;

			
	esttab 	tab5a_* using "${OUTPUT}/tab5.rtf", replace ${tab_optns} 
			keep(dv_judge) 
			scalars("cntrl Controls" "ymean Y Mean")
			title( {\b Table 5: Do DV Judges Make different Decisionsin Assault Cases? Panel A: Assault Cases});


restore	;	

# d cr  

********************************************************************************
*
**##  Panel B 
*
********************************************************************************

# d ; 

estimates clear ;
eststo clear ;
local m = 1 ;

eststo tab5b_`m': 
reghdfe guilty_case aslt_did aslt_case dv_judge , $hdfe_opts ;
	
	estadd ysumm	 		;
	estadd local cntrl	"" 	;
	local m `++m' 			;

eststo tab5b_`m': 
reghdfe guilty_case aslt_did aslt_case dv_judge $cntrls , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m'	 		;

eststo tab5b_`m': 
reghdfe guilty_count aslt_did aslt_case dv_judge , $hdfe_opts ;

	estadd ysumm	 		;
	estadd local cntrl	"" 	;
	local m `++m' 			;

eststo tab5b_`m': 
reghdfe guilty_count aslt_did aslt_case dv_judge $cntrls , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m'	 		;
			
eststo tab5b_`m': 
reghdfe incarcerated_case aslt_did aslt_case dv_judge , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"" 	;
	local m `++m'	 		;

eststo tab5b_`m': 
reghdfe incarcerated_case aslt_did aslt_case dv_judge $cntrls , $hdfe_opts ;
		
	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m' 			;
			
eststo tab5b_`m': 
reghdfe jail_time_case aslt_did aslt_case dv_judge , $hdfe_opts ;

	estadd ysumm			;
	estadd local cntrl	"" 	;
	local m `++m' 			;

eststo tab5b_`m': 
reghdfe jail_time_case aslt_did aslt_case dv_judge $cntrls , $hdfe_opts ;
	
	estadd ysumm			;
	estadd local cntrl	"X" ;
	local m `++m' 			;

esttab 	tab5b_* using "${OUTPUT}/tab5.rtf", append ${tab_optns} 
		keep(aslt_did aslt_case dv_judge) 
		scalars("cntrl Controls" "ymean Y Mean")
		title( {\b Panel B});

# d cr

********************************************************************************
*   End of File
********************************************************************************
